package com.example.oppotest.util;

import com.example.oppotest.util.youku.MapStrUtil;
import com.example.oppotest.util.youku.Md5Util;
import com.example.oppotest.util.youku.SignUtil;
import org.apache.commons.collections4.map.ListOrderedMap;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 * @Author wyk
 * @Date: 2025/2/25 21:53
 */
public class youkuUtils {

    public static final String appKey_1 = "30007127";

    public static final String token_1 = "HhIfJ7ILdIESUQCPBF692RQYc7GGCl2v";

    /*
    *
    * 用户产生一系列转化行为后，调用此API进行转化数据的回传上报
    *
    * */
    public static final String passbackUrl = "https://missile.youku.com/api/ad/conv/v2";


    public static void main(String[] args) {
        Map<String, Object> params = new ListOrderedMap<>();
        params.put("event_type", "download");
        String content = MapStrUtil.toStr(params);

        String signature = SignUtil.sign(appKey_1, token_1, content);
        System.out.println(signature);
    }


}
